package cn.sxgan.core.controller.api;

import cn.sxgan.common.entity.query.SysMenuQuery;
import cn.sxgan.common.entity.query.SysUserQuery;
import cn.sxgan.common.entity.sys.PageRequest;
import cn.sxgan.common.entity.vo.SysMenuVO;
import cn.sxgan.common.entity.vo.SysRoleAndMenuVO;
import cn.sxgan.common.entity.vo.SysRoleVO;
import cn.sxgan.common.entity.vo.SysUserAndRoleVO;
import cn.sxgan.common.entity.vo.SysUserVO;
import cn.sxgan.common.response.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Description: 用户、菜单查询控制器API
 * @Author: sxgan
 * @Date: 2024-11-12 14:15
 * @Version: 1.0
 **/
@Tag(name = "用户、菜单API", description = "用户及菜单处理")
public interface IUserMenuController {
    
    @Operation(summary = "查询用户列表", description = "查询用户列表")
    Result<List<SysUserVO>> findUserList(SysUserQuery sysUserQuery);
    
    @Operation(summary = "个人用户更新", description = "用户个人信息更新")
    Result<String> updateSysUserInfo(@RequestBody SysUserVO sysUserVO);
    
    @Operation(summary = "删除用户", description = "删除用户")
    Result<String> removeUser(@RequestParam Long userId);
    
    @Operation(summary = "查询用户角色列表", description = "查询用户角色列表")
    Result<List<SysUserAndRoleVO>> findUserRoleList(SysUserQuery sysUserQuery);
    
    @Operation(summary = "查询角色列表", description = "查询角色列表")
    Result<List<SysRoleVO>> findRoleList(PageRequest pageRequest);
    
    @Operation(summary = "添加角色", description = "添加角色")
    Result<String> addRole(@RequestBody SysRoleVO sysRoleVO);
    
    @Operation(summary = "编辑角色", description = "编辑角色")
    Result<String> editRole(@RequestBody SysRoleVO sysRoleVO);
    
    @Operation(summary = "删除角色", description = "删除角色")
    Result<String> removeRole(@RequestParam List<Long> roleIds);
    
    @Operation(summary = "绑定用户角色", description = "添加角色")
    Result<String> bindUserAndRole(@RequestParam Long userId, @RequestParam Long roleId);
    
    @Operation(summary = "查询菜单列表", description = "查询菜单列表")
    Result<List<SysMenuVO>> findMenuList(@ModelAttribute SysMenuQuery sysMenuQuery);
    
    @Operation(summary = "添加菜单", description = "添加菜单")
    Result<String> addMenu(@RequestBody SysMenuVO sysMenuVO);
    
    @Operation(summary = "编辑菜单", description = "编辑菜单")
    Result<String> editMenu(@RequestBody SysMenuVO sysMenuVO);
    
    @Operation(summary = "移除菜单", description = "移除菜单")
    Result<String> removeMenu(@RequestParam List<Long> menuIds);
    
    @Operation(summary = "绑定角色菜单", description = "绑定角色菜单")
    Result<String> bindRoleAndMenu(@RequestParam Long roleId, @RequestParam List<Long> menuIdList);
    
    @Operation(summary = "查询角色菜单列表", description = "查询角色菜单列表")
    Result<List<SysRoleAndMenuVO>> findRoleMenuList(@ModelAttribute PageRequest pageRequest);
    
    @Operation(summary = "查询当前用户菜单", description = "查询当前用户菜单")
    Result<List> findUserMenus();
}
